package com.demo.service.sys.impl;

import com.demo.dao.sys.mapper.SysCompanyTreeVOMapper;
import com.demo.dao.sys.mapper.SysDictionaryTypeTreeVOMapper;
import com.demo.dao.sys.mapper.SysMenuTreeVOMapper;
import com.demo.dao.sys.mapper.SysTupleItemVOMapper;
import com.demo.dao.sys.model.SysCompanyTreeItemVO;
import com.demo.dao.sys.model.SysDictionaryTypeTreeItemVO;
import com.demo.dao.sys.model.SysMenuTreeItemVO;
import com.demo.dao.sys.model.SysTupleItemVO;
import com.demo.service.sys.SysBasicVOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysBasicVOServiceImpl implements SysBasicVOService {
    @Autowired
    private SysMenuTreeVOMapper menuVOMapper;

    @Autowired
    private SysCompanyTreeVOMapper companyVOMapper;

    @Autowired
    private SysDictionaryTypeTreeVOMapper dictionaryTypeVOMapper;

    @Autowired
    private SysTupleItemVOMapper sysTupleItemVOMapper;

    //******************************************************************
    // 菜单查询
    //******************************************************************
    //查询1级菜单
    @Override
    public List<SysMenuTreeItemVO> getMenuItemVOByPid(Long pid){
        return menuVOMapper.getMenuItemVOByPid(pid);
    }

    //菜单树
    @Override
    public List<SysMenuTreeItemVO> getMenuTreeVO()
    {
        Long id = 0l;
        return getMenuItemVOByPid(id);
    }

    //******************************************************************
    // 公司查询
    //******************************************************************
    //公司部门树
    @Override
    public List<SysCompanyTreeItemVO> getCompanyVOTree()
    {
        return companyVOMapper.getCompanyVOTree();
    }

    //******************************************************************
    // 字典分类树查询
    //******************************************************************
    public List<SysDictionaryTypeTreeItemVO> getDictionaryTypeVOTree() {
        return dictionaryTypeVOMapper.getDictionaryTypeVOTree();
    }

    //根据图片url查询图元
    @Override
    public List<SysTupleItemVO> getTupleListByURL(String url) {
        return sysTupleItemVOMapper.getTupleListByURL(url);
    }
}
